/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "hos_internacion")
@NamedQueries({
    @NamedQuery(name = "HosInternacion.findAll", query = "SELECT h FROM HosInternacion h")})
public class HosInternacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "hin_id")
    private Integer hinId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "hin_fecha")
    @Temporal(TemporalType.DATE)
    private Date hinFecha;
    @OneToMany(mappedBy = "hosInternacion", fetch = FetchType.LAZY)
    private List<HosEvolucion> hosEvolucionList;
    @JoinColumn(name = "hrd_id", referencedColumnName = "hrd_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private HosRegistroDetalle hosRegistroDetalle;
    @JoinColumn(name = "eat_id", referencedColumnName = "eat_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private EmeAtencion emeAtencion;
    @OneToMany(mappedBy = "hosInternacion", fetch = FetchType.LAZY)
    private List<HosSignosVitales> hosSignosVitalesList;
    @OneToMany(mappedBy = "hosInternacion", fetch = FetchType.LAZY)
    private List<HosPedidoDieta> hosPedidoDietaList;
    @OneToMany(mappedBy = "hosInternacion", fetch = FetchType.LAZY)
    private List<HosCondicionPaciente> hosCondicionPacienteList;
    @OneToMany(mappedBy = "hosInternacion", fetch = FetchType.LAZY)
    private List<HosCambioTurnoPaciente> hosCambioTurnoPacienteList;

    public HosInternacion() {
    }

    public HosInternacion(Integer hinId) {
        this.hinId = hinId;
    }

    public HosInternacion(Integer hinId, Date hinFecha) {
        this.hinId = hinId;
        this.hinFecha = hinFecha;
    }

    public Integer getHinId() {
        return hinId;
    }

    public void setHinId(Integer hinId) {
        this.hinId = hinId;
    }

    public Date getHinFecha() {
        return hinFecha;
    }

    public void setHinFecha(Date hinFecha) {
        this.hinFecha = hinFecha;
    }

    public List<HosEvolucion> getHosEvolucionList() {
        return hosEvolucionList;
    }

    public void setHosEvolucionList(List<HosEvolucion> hosEvolucionList) {
        this.hosEvolucionList = hosEvolucionList;
    }

    public HosRegistroDetalle getHosRegistroDetalle() {
        return hosRegistroDetalle;
    }

    public void setHosRegistroDetalle(HosRegistroDetalle hosRegistroDetalle) {
        this.hosRegistroDetalle = hosRegistroDetalle;
    }

    public EmeAtencion getEmeAtencion() {
        return emeAtencion;
    }

    public void setEmeAtencion(EmeAtencion emeAtencion) {
        this.emeAtencion = emeAtencion;
    }

    public List<HosSignosVitales> getHosSignosVitalesList() {
        return hosSignosVitalesList;
    }

    public void setHosSignosVitalesList(List<HosSignosVitales> hosSignosVitalesList) {
        this.hosSignosVitalesList = hosSignosVitalesList;
    }

    public List<HosPedidoDieta> getHosPedidoDietaList() {
        return hosPedidoDietaList;
    }

    public void setHosPedidoDietaList(List<HosPedidoDieta> hosPedidoDietaList) {
        this.hosPedidoDietaList = hosPedidoDietaList;
    }

    public List<HosCondicionPaciente> getHosCondicionPacienteList() {
        return hosCondicionPacienteList;
    }

    public void setHosCondicionPacienteList(List<HosCondicionPaciente> hosCondicionPacienteList) {
        this.hosCondicionPacienteList = hosCondicionPacienteList;
    }

    public List<HosCambioTurnoPaciente> getHosCambioTurnoPacienteList() {
        return hosCambioTurnoPacienteList;
    }

    public void setHosCambioTurnoPacienteList(List<HosCambioTurnoPaciente> hosCambioTurnoPacienteList) {
        this.hosCambioTurnoPacienteList = hosCambioTurnoPacienteList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hinId != null ? hinId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HosInternacion)) {
            return false;
        }
        HosInternacion other = (HosInternacion) object;
        if ((this.hinId == null && other.hinId != null) || (this.hinId != null && !this.hinId.equals(other.hinId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.HosInternacion[ hinId=" + hinId + " ]";
    }
    
}
